<?php
// +----------------------------------------------------------------------
// | saithink [ saithink快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: sai <1430792918@qq.com>
// +----------------------------------------------------------------------
namespace plugin\saiadmin\app\logic\system;

use plugin\saiadmin\basic\BaseLogic;
use plugin\saiadmin\exception\ApiException;
use plugin\saiadmin\app\model\system\SystemDictData;
use plugin\saiadmin\app\model\system\SystemDictType;
use support\Cache;
use plugin\saiadmin\utils\Helper;

/**
 * 字典类型逻辑层
 */
class SystemDictDataLogic extends BaseLogic
{
    /**
     * 构造函数
     */
    public function __construct()
    {
        $this->model = new SystemDictData();
    }
    public function dictData($code){

        print_r(1111111111111111);exit();
        $data = Cache::get($code);
        if (!is_null($data)) {
            return $this->success($data);
        }
     
       
        $query = $this->where('status', 1)->where('code', $code)->field('id, label, value')->order('sort desc');
        $data = $this->getAll($query);
        Cache::set($code, $data);
        return $data;
    }  
}
